<template>
	<w-layout @scroll="scroll" showNavbar navTitle="标题" showTabbar>
		<template #sticky>
			<view>吸顶部分</view>
		</template>
		
		
		<template #default>
			<view class="aaa">
				{{ mixinData }}
				<view class="">
					{{publicStyles['--color']}}
				</view>
				<zui-svg-icon icon="round" spin />
				<zui-svg-icon icon="cart" spin />
				<up-icon name="sousuo" custom-prefix="custom-icon" :color="publicStyles['--color']" size="28"></up-icon>
				
				<up-button class="btn" type="primary" text="主题色" :color="publicStyles['--color']"></up-button>
				<view class="btn"></view>
				<up-button class="btn" type="primary" text="相似色1" :color="publicStyles['--color-s1']"></up-button>
				<view class="btn"></view>
				<up-button class="btn" type="primary" text="相似色2" :color="publicStyles['--color-s2']"></up-button>
				<view class="btn"></view>
				<up-button class="btn" type="primary" text="相似色3" :color="publicStyles['--color-s3']"></up-button>
				<view class="btn"></view>
				<up-button class="btn" type="primary" text="相反色" :color="publicStyles['--color-i']"></up-button>
				<up-button @click="useColor.setColor()" type="primary" text="随机切换颜色"></up-button>
			</view>
			<up-button type="primary" text="确定"></up-button>
			<view class="">
				底部
			</view>
		</template>

		
	</w-layout>
</template>

<script setup lang="ts">
	import { ref, onMounted,getCurrentInstance } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { useColorStore } from '@/store/color'
	import { useAppStore } from '@/store/app'
	import { storeToRefs } from 'pinia'
	import { postHome,postTest } from '@/utils/request/api';
	const useColor = useColorStore()
	const { publicStyles } = storeToRefs(useColor)
	console.log(publicStyles,'publicStyles')
	const useApp = useAppStore()
	// console.log(a,'window')
	onMounted(() => {
		setTimeout(()=>{
			useApp.loadingHandler(false)
		},500)
		// postTest({
		// 	c:3,
		// 	a:1,
		// 	b:2
		// }).then((res) => {
		// 	useApp.loadingHandler(false)
		// }).catch(() =>{
		// })
		// setTimeout(()=>{
		// 	uni.navigateTo({
		// 		url:'/pages/index/index'
		// 	})
		// },1000)
	})
	onLoad((options) => {
	})

	const scroll = (e) => {
		console.log(e, '子组件传来的数据')
	}
</script>

<style lang="scss">
	.aaa {
		height: 2000rpx;
		color: var(--color);
		transition: all 0.5s;
		
		.btn{
			margin: 10rpx 0;
			padding: 10rpx 0;
			transition: all 0.5s;
		}
	}
</style>